<!--鉴定审核受理 -->
<template>
    <el-main>
        <el-main class="ep-body">
            <epl-top-bar :datas="{formData:form,panel:panel}" showPerson personType="PERSON_ALL_EXACT" psTagType="PERSON_INJURY_QUERY">
                <ep-button size="small" name="刷新"></ep-button>
            </epl-top-bar>
            <epl-userMessage dataType="person" idCount="4" >
            </epl-userMessage>

            <el-card class="ep-card">

                <el-form :model="form"  :rules="rules" >
                    <ep-title>人员信息</ep-title>
                    <el-row :gutter="10">
                        <ep-input  label="人员id" name="aac001" :property="form.aac001"
                                   p="H"   :datas="{formData: form}" ></ep-input>
                        <ep-input  label="申报编号" name="bae506" :property="form.bae506"
                                   p="H"   :datas="{formData: form}" ></ep-input>
                        <ep-input colspan="8" label="工伤职工" name="aac003" :property="form.aac003"
                                  p="D"   :datas="{formData: form}" ></ep-input>
                        <ep-input colspan="8" label="身份证" name="aac147" :property="form.aac147"
                                  p="D"   :datas="{formData: form}" ></ep-input>
                        <ep-select colspan="8" label="鉴定类别" name="bae508" :property="form.bae508"
                                   codetype="BAE508"  p="D"
                                   :datas="{form: form}"></ep-select>
                    </el-row>
                    <el-row :gutter="10">
                        <ep-input colspan="24" label="单位名称" name="aab004" :property="form.aab004"
                                  p="D"  :datas="{formData: form}" ></ep-input>
                    </el-row>
                    <el-row :gutter="10">
                        <ep-date colspan="8" label="申请日期" name="aae127" :property="form.aae127"
                                 p="D"   :datas="{form: form}"></ep-date>
                        <ep-date colspan="8" label="伤病日期" name="alc020" :property="form.alc020"
                                 p="D"
                                 :datas="{form: form}"></ep-date>
                        <ep-select colspan="8" label="申请主体" name="alc009" :property="form.alc009"
                                   p="E"   codetype="ALC009"
                                   :datas="{form: form}"></ep-select>
                    </el-row>
                    <!--公共信息-->
                    <el-row :gutter="10">
                        <ep-select colspan="8" label="办理意见" name="bae507" :property="form.bae507"
                                   p="R"  codetype="BAE514S"  isChange
                                   :datas="{form: form}"></ep-select>

                    </el-row>
                    <!--受理信息-->
                    <el-row :gutter="10">
                        <ep-select colspan="8" label="鉴定方式" name="blc561" :property="form.blc561"
                                   p="H"  codetype="BLC561"
                                   :datas="{form: form}"></ep-select>
                    </el-row>
                    <el-row :gutter="10">
                        <ep-select colspan="8" label="鉴定场次名称" name="bac511" :property="form.bac511"
                                   p="H"
                                   :datas="{form: form}"></ep-select>
                        <ep-select colspan="8" label="鉴定科别" name="blc504" :property="form.blc504"
                                   p="H"  codetype="BLC504"
                                   :datas="{form: form}"></ep-select>

                        <ep-date colspan="8" label="鉴定时间" name="bae561" :property="form.bae561"
                                 p="H"
                                 :datas="{form: form}"></ep-date>
                    </el-row>
                    <el-row :gutter="10">
                        <ep-input colspan="16" label="鉴定地点" name="bae510" :property="form.bae510"
                                  p="H"
                                  :datas="{form: form}"></ep-input>
                    </el-row>
                    <!--不受理信息-->
                    <el-row :gutter="10">
                        <ep-input colspan="24" label="审查意见" name="blc500" :property="form.blc500"
                                  p="H"   :datas="{formData: form}" ></ep-input>
                    </el-row>
                    <el-row :gutter="10">
                        <ep-select colspan="24" label="不予受理依据" name="blc501" :property="form.blc501"
                                   p="H"  :datas="{form: form}" codetype="BLC501"></ep-select>
                    </el-row>
                    <!--补件信息-->
                    <el-row :gutter="10">
                        <ep-input colspan="16" label="补件原因" name="blc545" :property="form.blc545"
                                  p="H"  :datas="{form: form}" ></ep-input>
                        <ep-date colspan="8" label="补正截至日期" name="blc544" :property="form.blc544"
                                 p="H"  :datas="{form: form}"   ></ep-date>
                    </el-row>
                    <ep-title>补正材料</ep-title>
                        <ep-table :data="tableData2" border style="width: 100%;">
                            <el-table-column sortable prop="bae546" label="材料名称"></el-table-column>
                            <el-table-column sortable prop="bae547" label="适用类别"></el-table-column>
                        </ep-table>


                    <el-row :gutter="10">
                        <ep-select colspan="8" label="短信发送" name="bae515"  :property="form.bae515"
                                   p="R"   :datas="{form: form}" border ></ep-select>
                        <ep-input colspan="16" label="短信内容" name="bae547" :property="form.bae547"
                                  p="R"  :datas="{form :form}" ></ep-input>


                    </el-row>
                    <el-row type="flex" justify="center" >
                        <ep-saveButton id="" top="20" type="primary" bottom="20"
                                       :datas="{formData: form}" name="保存"></ep-saveButton>
                        <ep-Button id="" top="20" type="primary" bottom="20"
                                   name="清空"></ep-Button>
                    </el-row>
                </el-form>
            </el-card>
        </el-main>

    </el-main>

</template>

<script type="es6">
    export default {
        data() {
            return {
                form:{
                    aac001: {
                        value: '',
                        p: 'H'
                    },
                    bae506: {
                        value: '',
                        p: 'H'
                    },
                    aac003: {
                        value: '',
                        p: 'D'
                    },
                    aac147: {
                        value: '',
                        p: 'D'
                    },
                    bae508: {
                        key: '',
                        value: '',
                        p: 'D'
                    },
                    aab004: {
                        value: '',
                        p: 'D'
                    },
                    aae127: {
                        value: '',
                        p: 'D'
                    },
                    alc020: {
                        value: '',
                        p: 'D'
                    },
                    alc009: {
                        key: '',
                        value: '',
                        p: 'E'
                    },
                    bae507: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    blc561: {
                        key: '',
                        value: '',
                        p: 'H'
                    },
                    bac511: {
                        key: '',
                        value: '',
                        p: 'H'
                    },
                    blc504: {
                        key: '',
                        value: '',
                        p: 'H'
                    },
                    bae561: {
                        value: '',
                        p: 'H'
                    },
                    bae510: {
                        value: '',
                        p: 'H'
                    },
                    blc500: {
                        value: '',
                        p: 'H'
                    },
                    blc501: {
                        key: '',
                        value: '',
                        p: 'H'
                    },
                    blc545: {
                        value: '',
                        p: 'H'
                    },
                    blc544: {
                        value: '',
                        p: 'H'
                    },
                    bae515: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    bae547: {
                        value: '',
                        p: 'R'
                    },

                },
                tableData2: [],

                rules:{
                    bae507: [
                        {required: true, message: '必填项，不能为空'}
                    ],
                    bae515: [
                        {required: true, message: '必填项，不能为空'}
                    ],
                    bae547: [
                        {required: true, message: '必填项，不能为空'}
                    ],

                },
                codeTypes:{
                    BAE508:[],
                    ALC009:[],
                    BAE514S:[],
                    BLC561:[],
                    BLC504:[],
                    BLC501:[],

                },
                pager: {
                    page: 1,
                    size: 10
                },
                total: 0,
            }
        },
        computed: {
            backFun() {
                return this.$store.getters.backFun;
            },
            init_formData() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.form;
            },
            doInitformData: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.formData;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            init_form() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.form;
            },
            doInitform: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.form;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },

        },
        created() {
            let param = {
                path: this.$route.path,
                codeTypes:this.codeTypes,
                form:this.form,
                tableData2:this.tableData2

            };
            this.$store.dispatch('SET_INIT', param);
        },
        watch: {
            init_formData: {
                handler(value) {
                    if (value == undefined) return;
                    this.getformData(value);
                },
                deep: true
            },
            doInitformData: {
                handler(value) {
                    if (value == undefined) return;
                    this.getformData(value);
                },
                deep: true
            },
            init_form: {
                handler(value) {
                    if (value == undefined) return;
                    this.getform(value);
                },
                deep: true
            },
            doInitform: {
                handler(value) {
                    if (value == undefined) return;
                    this.getform(value);
                },
                deep: true
            },

            backFun: {
                handler(value) {
                    if (value === null) return;
                    this.customBackFun();
                    let backFun = [];
                    backFun = value.split(',');
                    if (backFun.indexOf('rDoInit') >= 0) {
                        let codeTypes = {
                            BAE508:[],
                            ALC009:[],
                            BAE514S:[],
                            BLC561:[],
                            BLC504:[],
                            BLC501:[],

                        };
                        let form = {
                            aac001: {
                                value: '',
                                p: 'H'
                            },
                            bae506: {
                                value: '',
                                p: 'H'
                            },
                            aac003: {
                                value: '',
                                p: 'D'
                            },
                            aac147: {
                                value: '',
                                p: 'D'
                            },
                            bae508: {
                                key: '',
                                value: '',
                                p: 'D'
                            },
                            aab004: {
                                value: '',
                                p: 'D'
                            },
                            aae127: {
                                value: '',
                                p: 'D'
                            },
                            alc020: {
                                value: '',
                                p: 'D'
                            },
                            alc009: {
                                key: '',
                                value: '',
                                p: 'E'
                            },
                            bae507: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            blc561: {
                                key: '',
                                value: '',
                                p: 'H'
                            },
                            bac511: {
                                key: '',
                                value: '',
                                p: 'H'
                            },
                            blc504: {
                                key: '',
                                value: '',
                                p: 'H'
                            },
                            bae561: {
                                value: '',
                                p: 'H'
                            },
                            bae510: {
                                value: '',
                                p: 'H'
                            },
                            blc500: {
                                value: '',
                                p: 'H'
                            },
                            blc501: {
                                key: '',
                                value: '',
                                p: 'H'
                            },
                            blc545: {
                                value: '',
                                p: 'H'
                            },
                            blc544: {
                                value: '',
                                p: 'H'
                            },
                            bae515: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            bae547: {
                                value: '',
                                p: 'R'
                            },

                        };
                        let tableData2= [];

                        let param = {
                            path: this.$route.path,
                            codeTypes:codeTypes,
                            form:form,
                            tableData2:tableData2

                        };
                        this.$store.dispatch('SET_INIT', param);
                    }
                }
            }
        },
        methods: {
            getformData(value) {
                this.form = value;
            },
            getform(value) {
                this.form = value;
            },

            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
            },
            handleEdit(id) {
                this.dialogFormVisible = true;
            },
            customBackFun(){//自定义方法体
            },
        },
    }
</script>
